<template>
	<view>
		<button class="index" @click="handleChangeButtonText">{{buttonText}}</button>
		<button class="index" @click="handleChangeLocal">{{localText}}</button>
	</view>
</template>

<script>
	import { mapActions, mapGetters } from 'vuex'
	export default {
		onLoad() {
			this.$storage('global').setItemSync('testItem', '这是测试本地存储')
			console.log(uni.getSystemInfoSync()) 
		},
		data() {
			return {
				localText: '获取本地储存'
			}
		},
		computed: {
			...mapGetters('global', ['buttonText'])
		},
		methods: {
			...mapActions('global', ['setButtonText']),
			handleChangeButtonText(){
				this.setButtonText('已更改 vuex 内容')
			},
			handleChangeLocal() {
				this.localText = this.localText = this.$storage('global').getItemSync('testItem')
			}
		}
	}
</script>

<style lang="scss" scoped>
.index {
	font-size: $uni-font-size-base;
	color: $uni-color-primary;
	height: 100px;
	width: 750px;
}
</style>
